home *** CD-ROM | disk | FTP | other *** search
/ ...taking it to the Macs! / ...taking it to the Macs!.iso / Extras / Internet Developer Demos / Bare Bones Software Goodies / BBEdit 4.0 Demo Folder / BBEdit Glossary / C Source / RoutineDescriptor < prev   
Text File  |  1995-07-24  |  763b  |  31 lines

  1. /* 
  2.  * #select#
  3.  */
  4.  
  5. //    typedef MACPASCAL SInt32 (*#select#) (SInt16 pData);
  6.  
  7. enum {
  8.     upp#select#Info = kPascalStackBased
  9.          | RESULT_SIZE(SIZE_CODE(sizeof(SInt32)))
  10.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SInt16)))
  11. };
  12.  
  13. #if USESROUTINEDESCRIPTORS
  14. typedef UniversalProcPtr #select#UPP;
  15.  
  16. #define Call#select#(userRoutine, data)        \
  17.         CallUniversalProc((UniversalProcPtr)(userRoutine), upp#select#Info,
  18.                             (data))
  19. #define New#select#(userRoutine)        \
  20.         (#select#UPP) NewRoutineDescriptor((ProcPtr)(userRoutine), \
  21.                                                upp#select#Info, \
  22.                                                GetCurrentISA())
  23. #else
  24. typedef #select# #select#UPP;
  25.  
  26. #define Call#select#(userRoutine, data)        \
  27.         (*(userRoutine))(data)
  28. #define New#select#(userRoutine)        \
  29.         (#select#UPP)(userRoutine)
  30. #endif
  31.